textview: add support for underline and strikethrough colors
authorChristian Hergert <christian@hergert.me>
Tue, 10 Feb 2015 00:41:48 +0000 (16:41 -0800)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 18 Mar 2015 03:24:13 +0000 (23:24 -0400)
commit28063ee2e42e7ce47b7bd5326f2d53875a377d57
treece7c2ca0667be5fee723de429ff60d1195cbe822
parent416c370da1d2eff2458e4a0c5b8e504cd8061559
textview: add support for underline and strikethrough colors

This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba
properties and the necessary plumbing to apply these colors in GtkTextLayout.
With this change, you can alter the color of underlines including those
of type PANGO_UNDERLINE_ERROR.

You might want to alter the underline color to differentiate between
spelling and grammer mistakes. In code editors, it is convenient to
differentiate between errors and warnings.

Note that the GtkTextAppearance struct is public ABI and has no spare
room for new fields, so we are resorting to some tricky packing to store
the colors in the unused pixel field of the fg_color and bg_color structs.
This packing is accomplished by the macros in gtktextattributesprivate.h.

Signed-off-by: Christian Hergert <christian@hergert.me>
https://bugzilla.gnome.org/show_bug.cgi?id=402168
gtk/Makefile.am
gtk/gtktextattributes.c
gtk/gtktextattributes.h
gtk/gtktextattributesprivate.h [new file with mode: 0644]
gtk/gtktextbuffer.c
gtk/gtktextdisplay.c
gtk/gtktextlayout.c
gtk/gtktexttag.c